﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
using System.Xml;

namespace Mesne
{
    public class MesneBinding : NetTcpBinding
    {
        public MesneBinding():base(SecurityMode.None, true)
        {
            CloseTimeout = new TimeSpan(0, 1, 0);
            OpenTimeout = new TimeSpan(0, 10, 0);
            ReceiveTimeout = new TimeSpan(0, 10, 0);
            SendTimeout = new TimeSpan(0, 1, 0);
            TransactionFlow = false;
            TransferMode = TransferMode.Buffered;
            MaxBufferPoolSize = 524288;
            MaxBufferSize = 65536;
            MaxConnections = 15;
            MaxReceivedMessageSize = 65536;
            //ReliableSession.Ordered = true;
            //ReliableSession.InactivityTimeout = new TimeSpan(0, 10, 0);

            this.ReaderQuotas = new XmlDictionaryReaderQuotas()
            {
                MaxDepth = 32,
                MaxStringContentLength = 8192,
                MaxArrayLength = 16384,
                MaxBytesPerRead = 4096,
                MaxNameTableCharCount = 16384,
            };
        }
    }
}
